package com.neoCalf.neoUser.feigns;

import com.neoCalf.neoCommon.entity.UserContact;
import com.neoCalf.neoCommon.entity.UserContactApply;
import com.neoCalf.neoCommon.model.R;
import org.jetbrains.annotations.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotEmpty;
import java.util.List;


@FeignClient(value = "contactService", path = "/api")
public interface ContactServiceFeign {
    /**
     * 添加联机器人
     */
    @PostMapping("/contact/addRobotContact")
    R<String> addContact(@RequestBody UserContact userContact);

    /**
     * 查找联系人列表
     */
    @PostMapping("/contact/selectContactList")
    R<List<UserContact>> selectContactList(@RequestParam("userId") String userId);

    /**
     * 查找好友申请列表
     */
    @PostMapping("/contact/selectUserContactApplyList")
    R<List<UserContactApply>> selectUserContactApplyList(@RequestParam("userId") String userId);

    /**
     * 根据用户id和联系人类型查找联系人
     */
    @PostMapping("/contact/findUserContactByType")
    R<List<UserContact>> findUserContactByType(@RequestParam("userId") @NotEmpty String userId,
                                               @RequestParam("contactType") @NotNull Integer contactType);
    /**
     * 根据用户id和联系人类型查找联系人数量
     */
    @PostMapping("/contact/findMyContactCount")
    R<Long> findMyContactCount(@RequestParam("userId") @NotEmpty String userId,
                               @RequestParam("typeList") @NotEmpty Integer[] typeList);
}
